dir = "C:\\00";
Files = require("./sdk/io/Files.js");

console.log(dir)
var fs = require('fs');

Files.walkFileTree(dir, function (path) {

   console.log(path)

   console.log('--------开始读取文件--------');


   var data = fs.readFileSync(path.pathfull);

   //var gbk_to_utf8 = new Iconv('GBK', 'UTF8');
   //var buffer = gbk_to_utf8.convert(fs.readFileSync('path/to/gbkencodefile'));
   //console.log(buffer.toString());
   var iconv = require("iconv-lite");
   data = iconv.decode(data, 'GBK');
   //console.log(data);

   newLocal = 'c:\\000tmp\\' + path.filename;
   fs.writeFileSync(newLocal, data);


   FileUtils = require("./sdk/io/FileUtils.js");
   FileUtils.readLinesFromtxt(newLocal, function (list) {
      var newdir = 'c:\\000tmp\\' + path.filename + "Fld"

      try{ fs.mkdirSync(newdir);}catch(e){}
     

      console.log(list);

      for (line of list) {
         var pathM = require('path');
         var basename = pathM.basename(line)
         var lineFileName = newdir + "\\" + basename + ".txt"
         try {
            fs.writeFileSync(lineFileName, line);
         } catch (error) {
            
         }
        
         //  console.log(key);
      }
   });


})